<%@ page language="java"  pageEncoding="UTF-8" %>
<%@ page import="com.shopping.modean.*" %>
<%@ page import="com.shopping.service.*" %>
<%@ page import="java.util.*" %>
<%@  include file="_session_check.jsp" %>

<%
  request.setCharacterEncoding("UTF-8");
  
  String action = request.getParameter("action");
  int id = Integer.valueOf(request.getParameter("id"));
  String pidStr = request.getParameter("pid");  
  int pid = pidStr == null ? 0 : Integer.parseInt(pidStr);  
  CategoryService categoryService = new CategoryService();
  //处理form表单提交
  if(action != null && action.trim().equals("categoryDelete")) {
	 categoryService.delete(id);
	 response.sendRedirect("category_list.jsp");
	 return;
  } else if(action != null && action.trim().equals("categoryDeleteSub")) {
	 categoryService.delete(id);
	 response.sendRedirect("category_list_sub.jsp?pid=" + pid);
	 return; 
  } 

%>

<!DOCTYPE html>
<html>
<head>
  <title>删除分类</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>

<body>

</body>
</html>